<?php  
	/**
	* 前台职位信息
	*/
	class ComShowViewModel extends ViewModel
	{
		public $table = 'company_baseinfo';

		public $view = array(
				'company_otherinfo' =>array(
					'type'=>INNER_JOIN,
					'on'=>'company_baseinfo.user_uid = company_otherinfo.user_uid'
					),
				'company_position' =>array(
					'type'=>INNER_JOIN,
					'on'=>'company_baseinfo.user_uid = company_position.user_uid'
					)
			);

		public function get_one($where)
		{

			$data = $this->join(array('company_otherinfo'))->where($where)->find();
			return $data;
		}

		public function get_all($where)
		{
			$data = $this->join(array('company_position'))->where($where)->all();
			$data = $this->deal_arr($data);

			return $data;
		}


		public function deal_arr($arr)
		{
			foreach ($arr as $k => $v) {
				$arr[$k]['cityname'] = K('City')->city[$arr[$k]['city_cityid']];
			}
			return $arr;
		}
	}
	
?>